// Created by WXX on 2021/9/5 13:39
#include <iostream>

using namespace std;

int rand7() {  // 返回[1, 7]中的随机数
    return rand() % 7 + 1;
}

class Solution {
public:
    int rand10() {
        int t = (rand7() - 1) * 7 + rand7();
        if (t > 40) t = rand10();
        return (t - 1) % 10 + 1;
    }
};

int main() {

    for (int i = 0; i < 10; i++)
        cout << Solution().rand10() << endl;

    return 0;
}
